/**
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved. <br/>
 */
package com.icinfo.cloud.provider.punish.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.icinfo.framework.tools.utils.StringUtils;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 描述: 直通车短信发送记录表-TRJ app_document_send_record 对应的实体类.<br>
 * WARNING：不是表中字段的属性必须加@Transient注解
 * @author lujiayu
 * @date 2024年01月10日
 */
@Table(name = "upcase.app_document_send_record")
@Data
@NoArgsConstructor
public class AppDocumentSendRecord implements Serializable {
    /**
     * 主键
     */
    @Id
    @Column(name = "id")
    private String id;

    /**
     * 文书id
     */
    @Column(name = "document_id")
    private String documentId;
    /**
     * 文书id
     */
    @Column(name = "phone")
    private String phone;
    /**
     * 发送时间
     */
    @Column(name = "send_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime sendTime;


    private static final long serialVersionUID = 1L;

    /**
     * 发送记录 构造器
     *
     * @param documentId 文书id
     * @param phone      发送手机号
     */
    public AppDocumentSendRecord(String documentId, String phone) {
        this.sendTime = LocalDateTime.now();
        this.id = StringUtils.uuid();
        this.documentId = documentId;
        this.phone = phone;
    }

}
